package com.shd.edanpei.util.contact;

import android.content.Context;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shd.edanpei.R;
import com.shd.edanpei.base.BaseQuickImageAdapter;

import de.hdodenhof.circleimageview.CircleImageView;

public class ContactsAdapter extends BaseQuickImageAdapter<ContactBean> {

    public ContactsAdapter(Context context) {
        super(context, R.layout.item_addressbooks);
    }

    @Override
    protected void convert(BaseViewHolder helper, ContactBean item) {

        if (!TextUtils.isEmpty(item.getPicUrl())) {
            mLoadImgCtrl.getGlide().load(item.getPicUrl()).into((CircleImageView) helper.getView(R.id.iv_head));
        } else{
            ((CircleImageView) helper.getView(R.id.iv_head)).setImageResource(R.drawable.ic_default_head);
        }

        helper.setText(R.id.tv_name, item.getName())
                .setText(R.id.tv_phone, item.getMobile());

    }

}
